package com.javarush.task.sql.task07.task0708;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;
import java.time.LocalDateTime;
import java.time.ZonedDateTime;

/*
Получение даты
*/

public class Solution {

    public static void main(String[] args) throws Exception {
        Connection connection = DriverManager.getConnection(
                "jdbc:mysql://localhost:3306/test",
                "root", "root");

        Statement statement = connection.createStatement();
        ResultSet results = statement.executeQuery("select * from employee");

        while (results.next()) {
            System.out.println(results.getString("name") + " " + results.getObject("created", LocalDateTime.class));
        }
        statement.close();
        connection.close();
    }
}
